home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / ScreenSavers / BackSpaceViews / StarShipView.BackModule / NewSpaceView.h < prev    next >
Encoding:
Text File  |  1995-06-12  |  2.2 KB  |  111 lines

  1. #import <appkit/appkit.h>
  2. #import <appkit/View.h>
  3. #import "StarShipProtocol.h"
  4.  
  5.  
  6. #define NSTARS (200)
  7. #define STARSPERIT (100)
  8.  
  9. typedef struct STAR {
  10.     float theta;    // angle
  11.     float distance;
  12.     float delta;    // change in distance
  13.     float ddelta;    // change in delta, a constant multiplier
  14.     int changemode;
  15.     char c;
  16.     float changepoint[6];
  17.     
  18.     NXPoint r1, r2;
  19.     NXPoint *draw;
  20.     NXPoint *erase;
  21.     
  22.     } STAR;
  23.  
  24. @interface NewSpaceView:View
  25. {
  26.     STAR stars[NSTARS];
  27.     id starShip;
  28.     id bodyController;
  29.     int nstars;
  30.     int radius;            // min radius of this view
  31.     float stopDelta;
  32.     
  33.     
  34.     NXRect smallScreenRect;  //for small screen info
  35.     BOOL firstState;
  36.     float lightColor;
  37.     float l_x_lightMin;
  38.     float r_x_lightMax;
  39.     float r_x_lightStart;
  40.     float l_x_lightStart;
  41.     float lightInc;
  42.  
  43.         struct screenLights{
  44.         float l_x_pos;
  45.         float r_x_pos;
  46.         float y_pos;
  47.     }lights;
  48.  
  49.     BOOL     stopped,stopping;
  50.     BOOL    hidden; //whether stars are hidden or not - disables stars
  51.     float speed;
  52.     float currentSpeed;
  53.     
  54.     int lightLimit;           // time to start lights over
  55.     int lightChangeTime;
  56.     int screenChangeTime;
  57.     int screenResizeLimit;
  58.     int screenResizeDir;     // 0 = bigger , 1 = smaller
  59.     NXPoint b[NSTARS];
  60.     NXPoint bOffsets[NSTARS];
  61.     char bc [NSTARS+1];
  62.     
  63.     NXPoint w[NSTARS];
  64.     NXPoint wOffsets[NSTARS];
  65.     char wc [NSTARS+1];
  66.     
  67.     NXRect voidRect;    //avoid the void!
  68.     Storage *avoidStorage;
  69.     int toggle;
  70.     NXSize oldSize;
  71.     float starSpeed;
  72.     
  73. }
  74.  
  75. - convertToXY:(STAR *)p;
  76. - oneStep;
  77. - (BOOL) allowBStars:(const STAR *)p;
  78. - (BOOL) allowWStars:(const STAR *)p;
  79. - drawSelf:(const NXRect *)rects :(int)rectCount;
  80. - sizeTo:(NXCoord)width :(NXCoord)height;
  81. - addStar;
  82. - replaceStarAt:(int)index;
  83. - setRadius;
  84. - (const char *)windowTitle;
  85. - didLockFocus;
  86. - (BOOL)useBufferedWindow;
  87. - setSmallScreenRect:(const NXRect *)newRect;
  88. - setStarShipOutlet:(id)outlet;
  89. - setBodyControllerOutlet:(id)outlet;
  90. - drawScreen;
  91. - drawScreenLights;
  92. - stopStars;            //gradual stop
  93. - startStars;
  94. - setStarsStopped;        //instant stop
  95. - (BOOL)isStopped;
  96. - (BOOL)isStopping;
  97.  
  98. - setStarSpeed:sender;
  99.  
  100.  
  101. - (BOOL)ignoreMouseMovement;
  102. - inspector:sender;
  103. - inspectorWillBeRemoved;
  104. - inspectorInstalled;
  105. @end
  106.  
  107.  
  108. @interface View(nonretainedFillMethod)
  109. - fillBoundsWithBlack;
  110. @end
  111.